
import baseStyle from './baseStyle';
import themeB from './themeB';
import themeA from './themeA';

function changeTheme(type) {
    let commonStyle = {}
    switch (type) {
        
        case "themeA":
            commonStyle = themeA
            break;
        case "themeB":
            commonStyle = themeB
            break;
        default:
            commonStyle = baseStyle
            break;
    }
   Object.keys(variables).forEach(key=>{
    if(commonStyle[key]){
        variables[key] = commonStyle[key]
    } 
   })
   return variables
}

const variables = {
    ...baseStyle
}




export default variables


function useTheme(args,type) {
    let variables = changeTheme(type)
    Object.assign(variables,args)
    return variables
}

export {
    changeTheme,
    useTheme
}